package com.citcc.business.mapper;

import com.citcc.business.bean.CdzAmountDetail;
import com.citcc.business.bean.dto.CdzAmountDetailCon;
import com.citcc.business.bean.vo.AmountDetailRecordVO;

import java.util.List;
import java.util.Map;

public interface CdzAmountDetailMapper {
    int deleteByPrimaryKey(String id);

    int insert(CdzAmountDetail record);

    int insertSelective(CdzAmountDetail record);

    CdzAmountDetail selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(CdzAmountDetail record);

    int updateByPrimaryKey(CdzAmountDetail record);

    List<CdzAmountDetail> selectList(CdzAmountDetailCon con);

    /**
     * 统计金额
     *
     * @param con
     * @return
     */
    Map<String, Object> selectSumDetail(CdzAmountDetailCon con);

    /**
     * 查询冻结记录
     *
     * @param con
     * @return
     */
    List<CdzAmountDetail> getFreezeAll(CdzAmountDetailCon con);

    /**
     * 根据用户ID、操作类型获取余额明细
     *
     * @param userId
     * @param type
     * @return
     */
    List<AmountDetailRecordVO> selectByUserIdAndType(String userId, String type);

    /**
     * 根据用户id，冻结类型，是否失效查询数据
     *
     * @param userId
     * @return
     */
    CdzAmountDetail selectByFreeze(String userId);
}